package com.wiscamp.ninechapters.problems.infrastructure.po.exams;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
 * 试卷部分
 */
@Entity
@Data
@Table(name = "paper_parts_view")
@EqualsAndHashCode
public class PaperPartView implements PersistenceObject {
    @Serial
    private static final long serialVersionUID = 7840108891636443467L;

    /**
     * 试卷部分编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "part_id", insertable = false, nullable = false)
    private long partId = 0;

    /**
     * 考试编号
     */
    @Column(name = "exam_id", nullable = false)
    private long examId = 0;

    /**
     * 大纲版本
     */
    @Column(name = "version", nullable = false)
    private String version = "";

    /**
     * 部分序号
     */
    @Column(name = "part_index", nullable = false)
    private int partIndex = 0;

    /**
     * 部分类型
     */
    @Column(name = "part_type_id", nullable = false)
    private int partTypeId = 0;

    /**
     * 部分名称
     */
    @Column(name = "part_name", nullable = false)
    private String partName = "";

    /**
     * 部分说明
     */
    @Column(name = "part_direction_description")
    private String partDirectionDescription = "";

    /**
     * 部分说明语音
     */
    @Column(name = "part_direction_audio")
    private String partDirectionAudio = "";

    /**
     * 分数
     */
    @Column(name = "score", nullable = false)
    private double score = 0;

    /**
     * 时间限制
     */
    @Column(name = "time_limit", nullable = false)
    private int timeLimit = 0;

    @Column(name = "exam_name", nullable = false)
    private String examName = "";

    @Column(name = "part_type_name", nullable = false)
    private String partTypeName = "";
}